Repository navigation
fix: 关闭动画时右键托盘图标需点击三次才打开快捷面板 - #113
Conversation
悬停卡片与快捷面板共用一个窗口。关闭动画时,右键先立即隐藏卡片,再在同一窗口打开面板;隐藏操作延后一帧执行,在面板显示后又把窗口藏起,界面却仍认为面板已打开。第二次右键因此只是“关闭”看不见的面板,第三次才真正打开。现在延后的隐藏与关闭记录在窗口已再次显示时跳过。
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b7141e159
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {"control":{"page":"components","windowMotion":"off","pointerOutside":true},"wait":700,"inspect":"layout","label":"motion-off","expect":{"animations.window":false}}, | ||
| {"probe":"hide","wait":300}, | ||
| {"control":{"trayFlyout":"card"},"wait":900,"inspect":"layout","label":"card","expect":{"tray.card":true,"tray.visible":true,"tray.animated":false,"tray.samplingShown":true},"captureFlyout":"card"}, | ||
| {"control":{"trayFlyout":"panel"},"wait":900,"inspect":"layout","label":"card-to-panel","expect":{"tray.panel":true,"tray.visible":true,"tray.samplingShown":true},"captureFlyout":"panel"}, |
There was a problem hiding this comment.
Reproduce the close-and-reopen sequence in the regression test
With window motion off, this step calls tray_panel directly through src-gpui/src/frontend/test_control.rs:24–30, replacing the card without closing it first. The real right-click path in src-gpui/src/shell.rs:1241–1246 closes the card before requesting the panel, which is what queues the stale deferred hide. Consequently, this regression test never exercises the new guards and can pass with the original bug intact. Add a test control that closes the card and opens the panel within the same effect cycle, and use it for the card-to-panel cases.
Useful? React with 👍 / 👎.
改动内容 / Changes
在 Windows 中关闭动画效果后,右键托盘图标需要点击三次才能打开快捷面板。
原因:悬停卡片与快捷面板共用同一个窗口。指针停在图标上时卡片已显示,右键时先关闭卡片,再在同一窗口打开面板。没有淡出时,卡片立即隐藏,但
SetWindowPos(SWP_HIDEWINDOW)被延后到下一帧执行,而此时面板已经显示,于是窗口又被藏起,界面却仍认为面板处于打开状态:开启动画时卡片经淡出关闭,
show会覆盖Leaving状态,因此不会出现此问题。修复:
Flyout::hide中延后执行的隐藏与tray_closed在窗口已再次显示(phase != Hidden)时跳过。后者同时避免面板打开期间set_flyout_open(false)让采样放慢。With Windows animations off, a right click on the tray icon needed three clicks to open the quick panel: closing the hover card hid the shared flyout window one frame later, after the panel had already been shown in it. The deferred hide and
tray_closednow skip when the window was shown again in the meantime.检查清单 / Checklist
<type>(<scope>): <描述>)/ The title and commit messages follow Conventional Commitsstart.bat check通过 /start.bat checkpasses(rustfmt、clippy -D warnings)docs/中对应的页面 / Behavior changes are reflected indocs/(无行为变化,仅修复)locales/的中文与英文目录 / New text is in both the Chinese and English catalogs underlocales/(无新文案)手动测试:关闭动画效果,指针停在托盘图标上待卡片出现后右键,一次即打开快捷面板;未出现卡片时直接右键同样正常。